Inbound Messages Callback
This callback delivers contact (end-user) messages to the API clients.
Message Fields
| Field | Type | Description |
|---|---|---|
id | string | Message ID |
direction | string | Always TO_APP for contact messages |
contact_message | object | The content of the message |
channel_identity | object | Identity of the contact in the underlying channel |
conversation_id | string | ID of the conversation. Empty if DISPATCH mode |
contact_id | string | ID of the contact. Empty if DISPATCH mode |
metadata | string | Channel-specific metadata |
accept_time | ISO 8601 timestamp | When the channel callback was received |
sender_id | string | Sender ID (e.g. originator MSISDN for SMS) |
processing_mode | string | Currently only DISPATCH mode supported |
Contact Message Types
Text Message
| Field | Type | Description |
|---|---|---|
text | string | The text included in the contact message |
Location Message
| Field | Type | Description |
|---|---|---|
title | string | Shown above the location |
coordinates.latitude | float | Latitude |
coordinates.longitude | float | Longitude |
label | string | Label or name for the position |
Choice Response Message
| Field | Type | Description |
|---|---|---|
message_id | string | The message ID containing the choice |
postback_data | string | Postback data from the selected choice |
Media Message
| Field | Type | Description |
|---|---|---|
url | string | URL of the media |
caption | string | Caption for the media |
Reply To
| Field | Type | Description |
|---|---|---|
message_id | object | ID of the message this contact message is responding to |
Only set if the response was sent within 3 days of the original message.
Product Response Message
| Field | Type | Description |
|---|---|---|
products | object array | Selected products |
text | string | Text sent with the products |
catalog_id | string | Catalog ID the products belong to |
Fallback Message
| Field | Type | Description |
|---|---|---|
reason.code | string | High-level error classification |
reason.description | string | Description of the reason |
reason.sub_code | string | More detailed error classification |
Channel Identity Fields
| Field | Type | Description |
|---|---|---|
channel | string | Channel identifier: SMS, RCS, WHATSAPP |
identity | string | Channel identity (e.g. phone number) |
app_id | string | App ID if app-scoped identity. Empty string otherwise |
Sample Inbound Message Payload
{
"app_id": "01EB37HMH1M6SV18ABNS3G135H",
"accepted_time": "2020-11-16T08:17:44.993024Z",
"project_id": "c36f3d3d-1523-4edd-ae42-11995557ff61",
"message": {
"id": "01EQ8235TD19N21XQTH12B145D",
"direction": "TO_APP",
"contact_message": { "text_message": { "text": "Hi!" } },
"channel_identity": { "channel": "WHATSAPP", "identity": "017838245667", "app_id": "01EB37HMH1M6SV18ABNS3G135H" },
"conversation_id": "01EQ8172WMDB8008EFT4M30481",
"contact_id": "01EQ4174TGGY5B1VPTPGHW19R0",
"accept_time": "2020-11-16T08:17:43.915829Z",
"sender_id": "12039414555",
"processing_mode": "CONVERSATION"
}
}